﻿using System.Windows.Controls;
using Button = System.Windows.Controls.Button;
using UserControl = System.Windows.Controls.UserControl;

namespace AccumulateApp.Control
{
    /// <summary>
    /// Interaction logic for JumpSlider2.xaml
    /// </summary>
    public partial class JumpSlider2 : UserControl
    {
        public JumpSlider2()
        {
            InitializeComponent();
        }

        private int CurrentValue { get; set; } = 0;
        private void Ticker_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Button button = sender as Button;
            if (button != null)
            {
                // 获取按钮的 Tag 属性值
                string tag = button.Tag as string;
                if (int.TryParse(tag, out int value))
                {
                    // 设置 CurrentValue 属性
                    CurrentValue = value;
                }

                // 取button 在Grid中的列
                int columnIndex = Grid.GetColumn(button);
                Grid.SetColumn(Ticker, columnIndex);
            }
        }
    }
}
